1. Field of the Invention
The present invention relates to a compression/decompression apparatus and a compression/decompression method.
2. Description of the Related Art
The data amount handled by electronic devices has been increasing in recent years. Accompanying this trend, the data amount shifted to an external memory is also increasing. Therefore, conventionally, an apparatus configuration has been employed such that when data is shifted from a buffer in an apparatus to an external memory, the data is compressed and written in the external memory via a bus, and when data is shifted from the external memory to the buffer in the apparatus, compressed data read from the external memory via a bus is decompressed and then written in the internal buffer.
For example, in a case of image data, block-shaped image data is compressed or decompressed for each pixel having 8-bit size in an uncompressed state by using a compression/decompression algorithm for sequentially performing compression and decompression. When the requirement of data transfer speed between the internal buffer and the external memory cannot be satisfied with a throughput of one pixel per cycle, a configuration is employed such that a plurality of compression apparatuses and decompression apparatuses are provided to parallelize compression/decompression processing (see, for example, Japanese Patent Application Laid-open No. 2008-252163). Because the compression/decompression algorithm used in this case is an algorithm in a unit of block data, the entire block data to be transferred is divided into a plurality of sub-block data elements, and these elements are processed in parallel.
However, for example, when one block data is divided into four sub-block data elements, data elements after compression are arranged in order of compression, transferred to an external memory in this order, and read from the external memory in this order. As a result, when compressed data is read from the external memory and decompressed, decompression processing is directly started for sub-block data elements arranged at the head. However, sub-block data elements arranged subsequent thereto are read from the external memory after read of the first sub-block data elements is finished. Therefore, the decompression processing for the subsequent data elements is not started unless read of the first sub-block data elements is finished. Likewise, the decompression processing for third sub-block data elements is not started unless read of the first and second sub-block data elements is finished. Further, the decompression processing for fourth sub-block data elements is not started unless read of the first, second, and third sub-block data elements is finished.
Therefore, even when decompression apparatuses are provided in the same number as the number of sub-block data elements, there can be a state that some of the decompression apparatuses cannot start processing and have to wait until transfer of at least the third sub-block data elements is completed, and thus high level parallelism cannot be maintained. Accordingly, there is a problem that a large number of cycles are required for decompression processing of the entire block data.
Therefore, an object of the present invention is to provide a compression/decompression apparatus and a compression/decompression method, which are capable of reducing the number of cycles required for decompression processing of the entire block data.